home *** CD-ROM | disk | FTP | other *** search
/ ftp.cs.arizona.edu / ftp.cs.arizona.edu.tar / ftp.cs.arizona.edu / icon / newsgrp / group97a.txt / 000067_icon-group-sender _Tue Mar 4 11:37:26 1997.msg < prev    next >
Internet Message Format  |  2000-09-20  |  4KB

  1. Received: by cheltenham.cs.arizona.edu; Tue, 4 Mar 1997 14:44:03 MST
  2. Message-Id: <199703041635.AA27705@optima.cs.arizona.edu>
  3. X-Sender: lindsay@mail.rmc.ca
  4. X-Mailer: Windows Eudora Light Version 1.5.2
  5. Mime-Version: 1.0
  6. Content-Type: text/plain; charset="us-ascii"
  7. Date: Tue, 04 Mar 1997 11:37:26 -0500
  8. To: gep2@computek.net, icon-group@cs.arizona.edu
  9. From: "John H. Lindsay" <lindsay_j@rmc.ca>
  10. Subject: Re: Icon and two-dimensional matching
  11. Errors-To: icon-group-errors@cs.arizona.edu
  12. Status: RO
  13. Content-Length: 3630
  14.  
  15. At 15:49 1997 03 03 -0600, you wrote:
  16. >Interesting article, however:
  17. >
  18. >>Icon and SNOBOL emphasize handling values rather than references 
  19. >although there are 'name' operators, and don't handle sub-arrays,
  20. >substrings or sublists as pseudovariables.  
  21. >
  22. >SNOBOL4 absolutely DOES support substrings as a pseudovariable, as long as the 
  23. >substring in question it the portion of the subject string that you're
  24. matching. 
  25. > This, in fact, is the basis for ALL pattern matching in SNOBOL4!
  26.  
  27. No, at least not in the sense that I'm speaking about.  Yes, it's possible 
  28. to replace a substring (assign to it) in the middle of a string, thus making 
  29. a string replacement statement a form of assignment.  But that alone 
  30. does not make a substring, either identified through pattern matching 
  31. or using SUBSTR into a pseudovariable; one can't form the NAME of any 
  32. sort of expression including a substring -- that's reserved to variables -- to 
  33. pass it as an argument IN SITU to a called function for example.  Passing 
  34. cross-sections of arrays to a routine is a bit more interesting in Algol 68 
  35. than in PL/I; in the latter, with the  *  as a sort of subscript meaning
  36. 'all the
  37. subscript values in this dimension' or with the once-proposed subrange 
  38. notation, the range of the subscripts for the cross-section argument and 
  39. corresponding parameter are inherited from those of the host array, but in 
  40. Algol 68, the range of subscripts of the slice defaults to from 1 to the 
  41. number of elements in that dimension of the slice or may be specified as 
  42. starting at any integer value as an optional part of  the 'trimscript' that 
  43. selects the slice from the host array.  In these cases, it can be recognized 
  44. that the slice (pseudovariable), while sharing storage with the host, is an 
  45. array in its own right.
  46.  
  47. >>I'm interested in generalized macro processing, where the macro 
  48. >processing becomes a method - a dynamic method - of program 
  49. >language development, and that plays just as much a part in program 
  50. >development as algorithm design, module design and data structure
  51. >design.  One specifies the TRANSLATION of algorithms, data 
  52. >specifications, ... into code.  Previous passes over the text or previous 
  53. >work in the same pass where rescanning is allowed, besides perhaps 
  54. >transforming the text, may decorate it with tokens (roughtly, a structure 
  55. >containing a source string and other information), or with trees or with 
  56. >other structures and with other information.  Then one has to recognize 
  57. >patterns among the tag-along information and source text, and to 
  58. >process it both by generating new information and transforming the 
  59. >structures and data that exist.
  60. >
  61. >One of the shortcomings of Icon (compared with S-BOL), IMO, is that Icon 
  62. >supports neither EVAL() nor CODE().  Admittedly these are features that one 
  63. >doesn't use often in most S-BOL programs, but when you -do- need them, they
  64. are 
  65. >absolutely indispensable!
  66.  
  67. Right !
  68.  
  69. >In the case in question, you could use the full features of S-BOL to modify
  70. the 
  71. >program itself at source level, and to replace almost any desired part of it 
  72. >with an "enhanced" version during program execution... even in the middle of a 
  73. >statement!
  74.  
  75. Right, but I'm considering general macro processing, and trying to avoid fixing 
  76. it to any one language or compiler, even though for what I'm doing, there
  77. has to 
  78. be a base language for the macro stuff.
  79.  
  80. >Gordon Peterson
  81. >http://www.computek.net/public/gep2/
  82.  
  83. All the best !
  84.  
  85. John H. Lindsay, Assistant Professor,
  86. DEPARTMENT OF MATHEMATICS AND COMPUTER SCIENCE
  87. ROYAL MILITARY COLLEGE OF CANADA
  88. PO BOX 17000  STN FORCES
  89. KINGSTON  ON   K7K7B4
  90.